<?php

namespace app\model;

use think\Model;

class Users extends BaseModel
{
    protected $hidden = [
        'delete_time', 'password'
    ];



    public function validatePassword(String $password)
    {

        return $this->password == $this->setSaltPwd($password);
    }

    //两次md5
    private function setPwd($pwd){
        return md5(md5($pwd));
    }

    //加盐md5
    public function setSaltPwd($pwd){

        return md5(md5($pwd).md5($pwd));
    }
}